#include <iostream>
#include <vector>
#include <algorithm>

using std::cout;
using std::endl;
using std::vector;
using std::remove_if;
using std::for_each;
void test0(){
    vector<int> vec = {1,9,3,4,2,8,2,3,1,9,5,3};
    for_each(vec.begin(),vec.end(),[](int value){
             cout << value << " ";
             });
    cout << endl;

    cout << endl;
    /* auto it = remove_if(vec.begin(),vec.end(),bind1st(std::less<int>(),5)); */
    auto it = remove_if(vec.begin(),vec.end(),bind2nd(std::greater<int>(),5));
    vec.erase(it,vec.end());
    for_each(vec.begin(),vec.end(),[](int value){
             cout << value << " ";
             });
    cout << endl;
}

int main(int argc, char * argv[])
{
    test0();
    return 0;
}


